home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / samples / dpmi / ctrlbrk.c next >
Encoding:
C/C++ Source or Header  |  1993-11-27  |  638 b   |  28 lines

  1. #include <stdio.h>
  2. #include <pc.h>
  3. #include <go32.h>
  4.  
  5. int main()
  6. {
  7.   printf("waiting and polling - press Ctrl-Break to\n");
  8.   printf("trigger handler, any other key to go on\n");
  9.   while (!kbhit())
  10.   {
  11.     if (_go32_was_ctrl_break_hit())
  12.       printf("ctrl-break detected in program\n");
  13.   }
  14.   printf("the key was %x\n", getkey());
  15.  
  16.   printf("releasing ctrl-break now\n");
  17.   _go32_want_ctrl_break(0);
  18.   
  19.   printf("waiting and polling - Pressing Ctrl-Break now\n");
  20.   printf("should cause an exception.\n");
  21.   while (!kbhit())
  22.   {
  23.   }
  24.   printf("the key was %x\n", getkey());
  25.   printf("exiting\n");
  26.   return 0;
  27. }
  28.